﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects.DataClasses;

namespace FRL.DebtChased.Repository
{

	/// <summary>
	/// Extensions to the Popup model
	/// </summary>
	public partial class Popup
	{

		/////////////////////////////////////////////////////////////
		// Static Operations

		public static Dictionary<int, string> LoadDictionary(DebtChasedEntities ent)
		{

			// Load dictionary from entities
			var results = from p in ent.Popups
						  orderby p.Name
						  select new { p.PopupId, p.Name };

			// Declare return variable
			Dictionary<int, string> Ftmp = new Dictionary<int,string>();
			foreach (var result in results)
				Ftmp.Add(result.PopupId, result.Name);

			// Return variable
			return Ftmp;

		}

	}

}
